home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 47 / MOBICLIC 47.ISO / mac / DATA / COMMUNS / MOBICLIC_MENUS.CST / 00006_Script_gestion du son < prev    next >
Text File  |  2002-09-19  |  3KB  |  106 lines

  1. -- gestion du son
  2.  
  3. global dernierSon,nivSon,volumeOn,menusActifs,ouvreVolume,  chemin, gFlag_soustitrage
  4. -- dernierSon : nom du dernier son jouΘ
  5. -- nivSon : liste α 3 termes contenant le niveau sonore de chaque piste
  6. -- volumeOn : indique si la fenΩtre de rΘglage du volume est active
  7.  
  8. -- lecture d'un son
  9.  
  10. on joueSon nom, n
  11.   if the paramCount = 1 then
  12.     n = 3
  13.   end if
  14.   if voidP(nivSon)=1 then
  15.     nivSon=[255,255,255]
  16.   end if
  17.   -- ajout Θventuel de "sons:"
  18.   if char 1 to 9 of nom <> "sons" then
  19.     if offset(":", nom) = 0 then
  20.       nom = "sons:" & nom
  21.     end if
  22.   end if
  23.   dernierSon = nom
  24.   --
  25.   put the pathName & nomDos(nom) & ".aif" into temp
  26.   put "  Son jouΘ : " & dernierSon
  27.   sound playFile n, temp
  28.   -- rΘglage du niveau des autres canaux
  29.   repeat with i=1 to 3
  30.     if i<>n and nivSon[i]>102 then
  31.       sound(i).volume = 110
  32.     end if
  33.   end repeat
  34.   ---------------------------------------lancement du sous-titrage pour les sourds------------ 
  35.   if gFlag_soustitrage = 1 then gere_soustitrage(nom)
  36.   --------------------------------------------------------------------------------------------
  37. end joueSon
  38.  
  39. -- jouer un son du cyberCalendrier
  40. on sonCyber son
  41.   global gNoABS_cyber
  42.   joueson gNoABS_cyber & "_" & son
  43. end
  44.  
  45. -- rΘglage du volume
  46. on niveauSon
  47.   if voidP(nivson) = 1 then
  48.     nivson=[255,255,255]
  49.   end if
  50.   repeat with i=1 to 3
  51.     sound(i).volume = nivSon[i]
  52.   end repeat
  53. end nivSon
  54.  
  55. -- affichage de la fenΩtre de rΘglage du volume
  56. on volume
  57.   volumeOn=1
  58.   --  afficherPistes (value(field "ppgs"))
  59.   menusActifs = 0
  60.   ouvreVolume=1
  61.   --  sprite(value(field "ppgs")).memberNum = member("volumeBD").number
  62.   --  sprite(value(field "ppgs")).locH = 320
  63.   --  sprite(value(field "ppgs")).locV = 240
  64.   --  updateStage
  65.   
  66.   put "  Ouverture du rΘglage du volume"
  67. end volume
  68.  
  69. -- dissimulation de la fenΩtre de rΘglage du volume
  70. on volumeOff
  71.   --  masquerPistes (value(field "ppgs"))
  72.   --  sprite(value(field "ppgs")).memberNum = member("pointPourGlisserSur").number
  73.   menusActifs = 1
  74.   volumeOn=0
  75.   --  unloadMember member "volumeBD"
  76.   put "  Fermeture du rΘglage du volume avec les valeurs : " & nivSon
  77. end volumeOff
  78.  
  79. -- attendre la fin d'un son
  80. on attendreSon p
  81.   set T = 1.0/the frameTempo
  82.   repeat while soundBusy(p)
  83.     updateStage
  84.     temporise(T)
  85.   end repeat
  86. end
  87.  
  88. -- dΘsactivation des pistes audio
  89. on coupeSon
  90.   repeat with i=1 to the paramCount
  91.     if value(param(i))<>0 then
  92.       puppetSound (param(i)),0
  93.     else
  94.       listeSons param(i)
  95.     end if
  96.   end repeat
  97. end coupeSon
  98.  
  99. on listeSons chaine
  100.   n=offset(">", chaine)
  101.   n1=value(char 1 to n-1 of chaine)
  102.   n2=value(char n+1 to length(chaine) of chaine)
  103.   repeat with j=n1 to n2
  104.     puppetSound j,0
  105.   end repeat
  106. end listeSons